<!DOCTYPE HTML>
<html lang="zh-CN">
    <head>
        <title>JSON格式化查看工具</title>
        <meta charset="UTF-8">
        <link rel="stylesheet" href="index.css" />
        <script type="text/javascript" src="../static/vendor/vue/vue.js"></script>
        <script src="../static/vendor/require/require.js"></script>
    </head>
    <body>
        <div class="wrapper wp-json" id="pageContainer">
            <div class="panel panel-default" style="margin-bottom: 0px;">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        <a href="http://www.baidufe.com/fehelper/feedback.html" target="_blank" class="x-a-high">
                            <img src="../static/img/fe-16.png" alt="fehelper"/> FeHelper</a>：JSON格式化查看
                        <span class="x-xdemo" ref="demoLink1" @click="setDemo">示例1：JSON片段</span>
                        <a class="x-xdemo" href="http://t.weather.sojson.com/api/weather/city/101030100" target="_blank">示例2：在线JSON-1</a>

                        <span id="layoutBar">
                            <button id="btnLeftRight" ref="btnLeftRight" class="selected" @click="changeLayout('left-right')">左右布局</button><button id="btnUpDown" ref="btnUpDown" @click="changeLayout('up-down')">上下布局</button>
                        </span>
                    </h3>
                </div>
            </div>

            <div class="panel-body mod-json" ref="panelBody">
                <div class="row panel-txt">
                    <textarea class="form-control mod-textarea" id="jsonSource" placeholder="在这里粘贴您需要进行格式化的JSON代码" ref="jsonBox"></textarea>
                    <div class="ui-mt-10">
                        <button id="btnFormat" class="btn btn-primary" @click="format">格式化</button>
                        <button id="btnCompress" class="btn btn-success" @click="compress">压缩</button>
                        <input type="checkbox" v-model="jsonLintSwitch" id="jsonLint" @click="lintOn"><label for="jsonLint">开启JSONLint</label>
                        <input type="checkbox" v-model="overrideJson" id="jsonOvrd" @click="setCache"><label for="jsonOvrd">选中JSON并编辑</label>
                        <span class="x-sort">
                            <span class="x-split">|</span>
                            <span class="x-stitle">JSON排序：</span>
                            <label for="sort_null">默认</label>
                            <input type="radio" name="jsonsort" id="sort_null" value="0" checked @click="format">
                            <label for="sort_asc">升序</label>
                            <input type="radio" name="jsonsort" id="sort_asc" value="1" @click="format">
                            <label for="sort_desc">降序</label>
                            <input type="radio" name="jsonsort" id="sort_desc" value="-1" @click="format">
                        </span>
                    </div>
                    <div id="errorTips" v-bind:style="{display:showTips?'block':'none'}">
                        <div id="errorBtn" @click="closeTips"><span id="closeError">☓</span></div>
                        <div id="tipsBox" v-html="errorPos"></div>
                        <div id="errorCode" v-html="errorJsonCode"></div>
                    </div>
                </div>

                <div class="row rst-item" id="modJsonResult">
                    <div id="formattingMsg"><span class="x-loading"></span>格式化中...</div>
                    <div id="jfCallbackName_start" class="callback-name" v-html="jfCallbackName_start"></div>
                    <div id="jfContent" v-html="resultContent"></div>
                    <pre id="jfContent_pre"></pre>
                    <div id="jfCallbackName_end" class="callback-name" v-html="jfCallbackName_end"></div>
                </div>
            </div>

        </div>
        <script src="../static/vendor/jquery/jquery-3.3.1.min.js"></script>
        <script src="../static/vendor/codemirror/codemirror.js"></script>
        <script src="../static/vendor/codemirror/javascript.js"></script>
        <script src="../static/vendor/codemirror/active-line.js"></script>
        <script src="../static/vendor/codemirror/matchbrackets.js"></script>
        <script src="../static/vendor/codemirror/placeholder.js"></script>
        <script src="index.js"></script>
    </body>
</html>